package models

import (
	"common/uuid"
	"database/sql"
	"time"
)

type User struct {
	ID           uuid.UUID    `gorm:"column:id;primaryKey;type:binary(16);NOT NULL;comment:用户id" json:"id"`
	Username     string       `gorm:"column:username;size:100;NOT NULL;default:\"\";comment:用户名" json:"username"`
	Phone        string       `gorm:"column:phone;size:100;NOT NULL;default:\"\";comment:用户手机" json:"phone"`
	Email        string       `gorm:"column:email;size:100;NOT NULL;default:\"\";comment:用户邮箱" json:"email"`
	PasswordHash []byte       `gorm:"column:password_hash;size:500;NOT NULL;default:\"\";comment:用户密码" json:"-"`
	SecretKey    []byte       `gorm:"column:secret_key;size:500;comment:用户密钥" json:"secret_key"`
	CreatedAt    time.Time    `gorm:"column:created_at;type:time;NOT NULL;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt    time.Time    `gorm:"column:updated_at;type:time;NOT NULL;default:CURRENT_TIMESTAMP" json:"updated_at"`
	DeletedAt    sql.NullTime `gorm:"column:deleted_at;" json:"deleted_at"`
}
